<template>
	<view class="box">
		<view class="title">
			<view class="top">
				{{detail.title}}
			</view>
			<view class="but">
				<text>{{detail.creatorName}}</text>
				<text>{{detail.createdAt}}</text>
			</view>
		</view>
		<view class="txt" v-html="detail.content"></view>
	</view>
</template>

<script>
	import {
		getCommunityDetail
	} from '@/api/home/home.js'
	export default {
		data() {
			return {
				detail: {}
			}
		},
		methods: {
			async getCommunityDetail(id) {
				const res = await getCommunityDetail(id)
				this.detail = res.data
			}
		},
		onLoad(options) {
			this.getCommunityDetail(options.id)
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		.title {
			height: 120rpx;
			width: 750rpx;
			border-bottom: 1px solid #F2F2F6;
			padding: 0rpx 30rpx;
			box-sizing: border-box;

			.top {
				color: #333333;
				font-size: 32rpx;
				line-height: 1.5;
				margin-top: 24rpx;
				margin-bottom: 11rpx;
			}

			.but {
				display: flex;
				justify-content: space-between;
				color: #BDBDBD;
				font-size: 24rpx;
				line-height: 1.5;
			}
		}

		.txt {
			width: 750rpx;
			padding: 30rpx;
			box-sizing: border-box;
			color: #686868;
			font-size: 28rpx;
			line-height: 1.5;
		}
	}
</style>
